<template>
  <div>
    <el-container>
      <!-- 左侧栏 -->
      <el-aside width="200px"  class="el-aside" :style="containerHeight">
        <Sidebar />
      </el-aside>

      <el-container>
        <!-- 头部 -->
        <!-- <el-header>
          <el-avatar class="avatar"> {{user.data.userName}} </el-avatar>
        </el-header> -->
        <!-- 主题内容 -->
        <el-main class="elmain">
            <!-- 路由出口 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<style scoped>
  .avatar{
    margin-top: 20px;
    margin-left: 1200px;
  }
  
</style>
<script>
import Sidebar from "../components/Sidebar.vue";
export default {
  data() {
    return {
      user:[],
      containerHeight:{
        height : "",

      }
    };
  },
  // 引入组件
  components: {
    Sidebar,
  },
 created(){
   const users = JSON.parse(sessionStorage.getItem("user"));
   console.log(users)
   this.user = users
    //动态调整左侧菜单栏高度
    // var docHeight = document.documentElement.clientHeight;
    // this.containerHeight.height = docHeight - 20 + "px";
  
 }
};
</script>